from boot import QFrame, QWidget, QHBoxLayout, QVBoxLayout, Union, Qt


__all__ = ["QQ9VLayoutWidget", "QQ9HLayoutWidget"]


class QQ9VLayoutWidget(QWidget):

    def __init__(self, parent: Union[QWidget, None] = None):
        super().__init__(parent)

        # 主布局
        self.main_v_layout = QVBoxLayout()
        self.main_v_layout.setContentsMargins(0, 0, 0, 0)
        self.main_v_layout.setSpacing(20)
        self.setLayout(self.main_v_layout)

    def add_widget(self, *args, **kwargs):
        self.main_v_layout.addWidget(*args, **kwargs)


class QQ9HLayoutWidget(QWidget):

    def __init__(self, parent: Union[QWidget, None] = None):
        super().__init__(parent)

        # 主布局
        self.main_v_layout = QHBoxLayout()
        self.main_v_layout.setContentsMargins(0, 0, 0, 0)
        self.main_v_layout.setAlignment(Qt.AlignCenter)
        self.main_v_layout.setSpacing(20)
        self.setLayout(self.main_v_layout)

    def add_widget(self, *args, **kwargs):
        self.main_v_layout.addWidget(*args, **kwargs)